package avicit.bdp.dds.dao.mapper;

import avicit.bdp.common.base.BaseDAO;
import avicit.bdp.common.service.dto.TaskSpeedDTO;
import avicit.bdp.dds.dao.entity.TaskLog;
import org.apache.ibatis.annotations.Param;

public interface TaskLogMapper extends BaseDAO<TaskLog> {

  void insertTaskLog(@Param("id") String id, @Param("contents") String contents);

  int getDefinitionTypeByTaskId(@Param("id") String id);

  void insertTaskSpeed(
      @Param("id") String id,
      @Param("processInstanceId") String processInstanceId,
      @Param("taskInstanceId") String taskInstanceId,
      @Param("stage") Long stage,
      @Param("totalStage") Long totalStage,
      @Param("readSucceedRecords") Long readSucceedRecords,
      @Param("readSucceedBytes") Long readSucceedBytes,
      @Param("readFailedRecords") Long readFailedRecords,
      @Param("readFailedBytes") Long readFailedBytes,
      @Param("writeSucceedRecords") Long writeSucceedRecords,
      @Param("writeSucceedBytes") Long writeSucceedBytes,
      @Param("writeFailedRecords") Long writeFailedRecords,
      @Param("writeFailedBytes") Long writeFailedBytes,
      @Param("endTimestamp") Long endTimestamp);

  void updateTaskSpeed(
      @Param("id") String id,
      @Param("processInstanceId") String processInstanceId,
      @Param("taskInstanceId") String taskInstanceId,
      @Param("stage") Long stage,
      @Param("totalStage") Long totalStage,
      @Param("readSucceedRecords") Long readSucceedRecords,
      @Param("readSucceedBytes") Long readSucceedBytes,
      @Param("readFailedRecords") Long readFailedRecords,
      @Param("readFailedBytes") Long readFailedBytes,
      @Param("writeSucceedRecords") Long writeSucceedRecords,
      @Param("writeSucceedBytes") Long writeSucceedBytes,
      @Param("writeFailedRecords") Long writeFailedRecords,
      @Param("writeFailedBytes") Long writeFailedBytes,
      @Param("endTimestamp") Long endTimestamp);

  TaskSpeedDTO selectOneTaskSpeed(
      @Param("processInstanceId") String processInstanceId,
      @Param("taskInstanceId") String taskInstanceId,
      @Param("endTimestamp") Long endTimestamp);

  void insertTaskLogOverWrite(@Param("id") String id, @Param("contents") String contents);

  int countTaskLog(@Param("taskId") String taskId);

  void updateTaskLog(@Param("taskId") String taskId, @Param("contents") String contents);
}
